/**
 * Copyright(c) Yystar Technology Co.,Ltd
 * project：security
 * package：com.yystar.security.op.service.impl
 * fileName：UserServiceImpl.java
 * date：2013-6-27
 */
package com.yystar.security.op.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yystar.security.op.dao.UserDao;
import com.yystar.security.op.domain.User;
import com.yystar.security.op.service.UserService;

/**
 * @author Vistaa Peng
 * @date 2013-6-27
 * @todo TODO
 * @modify	<BR>
 * 1.2013-6-27 Vistaa Peng Create file.
 */
@Service
public class UserServiceImpl implements UserService {

	@Resource
	private UserDao userDao;
	
	/* (non-Javadoc)
	 * @see com.yystar.security.op.service.UserService#getUsers()
	 */
	@Override
	public List<User> getUsers() {
		// TODO Auto-generated method stub
		return userDao.getUsers();
	}

	/* (non-Javadoc)
	 * @see com.yystar.security.op.service.UserService#addUser(java.lang.String)
	 */
	@Override
	public int addUser(User user) {
		// TODO Auto-generated method stub
		return userDao.save(user);
	}

	/* (non-Javadoc)
	 * @see com.yystar.security.op.service.UserService#updateUser(java.lang.String)
	 */
	@Override
	public int updateUser(User user) {
		// TODO Auto-generated method stub
		return userDao.update(user);
	}

	/* (non-Javadoc)
	 * @see com.yystar.security.op.service.UserService#deleteUser(java.lang.String)
	 */
	@Override
	public int deleteUser(String userName) {
		// TODO Auto-generated method stub
		return userDao.delete(userName);
	}

}
